<?php

namespace app\admin\model;

use think\Model;

/**
 * Goods
 * @controllerUrl 'goods'
 */
class Goods extends Model
{
    // 表主键
    protected $pk = 'GOODSID';
    
    // 表名
    protected $table = 'goods';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    protected $createTime = false;
    protected $updateTime = false;



    public function getRefitdemoAttr($value, $row)
    {
        return !$value ? '' : $value;
    }

    public function getPressuredemoAttr($value, $row)
    {
        return !$value ? '' : $value;
    }

    public function getMsdsfilesAttr($value, $row)
    {
        if ($value == '') {
            return [];
        }
        if (!is_array($value)) {
            return explode(',', $value);
        }
        return $value;
    }

    public function setMsdsfilesAttr($value, $row)
    {
        if ($value && is_array($value)) {
            return implode(',', $value);
        }
        return $value ? $value : '';
    }
}